<?php
namespace app\serveraddress\validate;

use \app\manage\validate\BaseValidate;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2017/6/16
 * Time: 17:42
 */
class Address extends BaseValidate
{
    protected $rule = [
        'id'        => ['require', 'number', 'gt'=>0],
        "pid"       => ['require', 'number'],
        "name"      => ['require', 'chs'],
        "py_name"   => ['require', 'alpha'],
        "zipcode"   => ['require', 'number'],
        "special"   => ['require', 'number'],
    ];

    protected $scene = [
        'add'  => ['pid', 'name', 'py_name', 'zipcode', 'special'],
        'edit' => [
            'id',
            'pid' => ['number'],
            'name' => ['chs'],
            'py_name' => ['alpha'],
            'zipcode' => ['number'],
            'special' => ['number']
        ],
        'pid' => ['pid'],
    ];
}